package ChaiPiao;

/**
 * Created by 菜花 on 2017/3/9.<br></>
 * gameId 这个filed在selection被加入game的时候会被自动设置为加入赛事的id<br></>
 * 如果selection已经被设置了赛事id，这时候如果和被加入的赛事id不一致，将无法加入成功！
 */
public class GameSelection {


    private String gameId;
    private String playType;
    private String typeValue;

    public GameSelection(String playType, String typeValue) {
        this.playType = playType;
        this.typeValue = typeValue;
    }

    public GameSelection(String gameId, String playType, String typeValue) {
        this.gameId = gameId;
        this.playType = playType;
        this.typeValue = typeValue;
    }

    public String getGameId() {
        return gameId;
    }

    public void setGameId(String gameId) {
        this.gameId = gameId;
    }

    public String getPlayType() {
        return playType;
    }

    /*****************************
     * get set equals
     ***********************************/
    public void setPlayType(String playType) {
        this.playType = playType;
    }

    public String getTypeValue() {
        return typeValue;
    }

    public void setTypeValue(String typeValue) {
        this.typeValue = typeValue;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GameSelection that = (GameSelection) o;

        if (gameId != null ? !gameId.equals(that.gameId) : that.gameId != null) return false;
        if (playType != null ? !playType.equals(that.playType) : that.playType != null) return false;
        return typeValue != null ? typeValue.equals(that.typeValue) : that.typeValue == null;
    }

    @Override
    public int hashCode() {
        int result = gameId != null ? gameId.hashCode() : 0;
        result = 31 * result + (playType != null ? playType.hashCode() : 0);
        result = 31 * result + (typeValue != null ? typeValue.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return gameId + ":" + playType + ":" + typeValue;
    }
}
